<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">

        <common-head></common-head>
       
    </div>
    <script src="./vue.js"></script>
    <script>
        let Child = {
            template:`
                <h5>我是一个子组件</h5>
            `
        }
        let CommonHead = {
            template:`
                <div>
                    <h1>我是公共的头部{{msg}}</h1>
                    <child></child>
                </div>
            `,
           data(){
               return {
                   msg:"我是组件内的"
               }
           },
           methods:{
               change(){
                   this.msg="数据改变了";
               }
           },
           computed:{
               msg2(){
                   return this.msg + "111";
               }
           },
           components:{
                Child
           }
        }
     
        let vm = new Vue({
            el:"#app",
            components:{
                CommonHead
            }   
        })

    </script>
</body>
</html>